package threadsDemo;

import org.junit.Test;

public class NumberRangeTest {

	@Test
	public void testSetRange() {
		NumberRange numberRange = new NumberRange(0, 5);
		Thread thread0 = new Thread(new Runnable() {
			public void run() {
				numberRange.setLower(4);
				System.out.println("thread0 -- "+numberRange.toString());				
			}
		});
		
		Thread thread1 = new Thread(new Runnable() {
			public void run() {
				numberRange.setUpper(3);
				System.out.println("thread1 -- " + numberRange.toString());				
			}
		});
		
		thread0.start();
		thread1.start();
	}
}
